<template>
  <custom-layout :isTabBar="false" navTitle="个人信息">
    <uni-list class="user-info">
      <uni-list-item v-for="item in items" :key="item.key" :title="item.label" :rightText="data[item.key]" />
    </uni-list>
  </custom-layout>
</template>

<script>
export default {
  data() {
    return {
      items: [
        { key: "userName", label: "用户名", icon: "" },
        { key: "nickName", label: "用户昵称", icon: "" },
        { key: "phoneNumber", label: "手机号", icon: "" },
        { key: "email", label: "邮箱", icon: "" },
        { key: "roleName", label: "角色", icon: "" },
        { key: "createTime", label: "创建时间", icon: "" },
      ],
      data: {},
    };
  },
  onLoad() {
    const { user, roles } = this.$store.getters;
    this.data = user;
    this.data.roleName = roles[0]?.roleName;
  },
  methods: {},
};
</script>

<style lang="scss" scoped></style>
